package main.java.com.study.设计模式.單例.study实现Map单例;

import java.util.HashMap;

/**
 * Created by .
 */
public class SingleMapDemo {

    //创建 SingleObject 的一个对象
    private static SingleMapDemo instance = new SingleMapDemo();

    //让构造函数为 private，这样该类就不会被实例化
    private SingleMapDemo(){}

    //获取唯一可用的对象
    public static SingleMapDemo getInstance(){
        return instance;
    }

    public void showMessage(){
        System.out.println("Hello World!");
    }

    public void showMap(HashMap map){
        System.out.println(map);
    }


}
